home *** CD-ROM | disk | FTP | other *** search
/ Software Vault: The Gold Collection / Software Vault - The Gold Collection (American Databankers) (1993).ISO / cdr01 / halcn305.zip / GSDMO_02.PAS < prev    next >
Pascal/Delphi Source File  |  1993-05-02  |  2KB  |  70 lines

  1. program GSDMO_02;
  2. {------------------------------------------------------------------------------
  3.                               DBase File Lister
  4.  
  5.        Copyright (c)  Richard F. Griffin
  6.  
  7.        20 January 1993
  8.  
  9.        102 Molded Stone Pl
  10.        Warner Robins, GA  31088
  11.  
  12.        -------------------------------------------------------------
  13.        This program demonstrates how dBase files may be listed using
  14.        Griffin Solutions units.
  15.  
  16.        If the GSDMO_01.DBF file does not exist, the program will display a
  17.        a message that the file was not found and to run GSDMO_01 to make
  18.        the file.
  19.  
  20.        The program opens a dBase file and proceeds to list selected fields
  21.        from each record.
  22.  
  23.        New procedures/functions introduced are:
  24.  
  25.                  CloseDataBases
  26.                  dEOF
  27.                  FieldGet
  28.                  FileExist
  29.                  GoTop
  30.                  Select
  31.                  Skip
  32.                  Use
  33.  
  34. -------------------------------------------------------------------------------}
  35.  
  36. uses
  37.    GSOBShel,
  38.    {$IFDEF WINDOWS}
  39.       WinCRT,
  40.       WinDOS;
  41.    {$ELSE}
  42.       CRT,
  43.       DOS;
  44.    {$ENDIF}
  45.  
  46.  
  47. begin
  48.    ClrScr;
  49.    if not FileExist('GSDMO_01.DBF') then   {Check for the file}
  50.    begin
  51.       writeln('File GSDMO_01.DBF not found.  Run GSDMO_01 to create.');
  52.       halt;
  53.    end;
  54.                        {The 'Real' example starts here}
  55.  
  56.    Select(1);                     {Use record area 1 (the default)}
  57.    Use('GSDMO_01');               {Assign the dBase III file GSDMO_01}
  58.    GoTop;                         {Get the first record in the file}
  59.    while not dEOF do              {Repeat until end-of-file}
  60.    begin
  61.       writeln(FieldGet('LASTNAME'),' ',       {Get field images}
  62.               FieldGet('FIRSTNAME'),'  ',
  63.               FieldGet('BIRTHDATE'));
  64.       Skip(1);                    {Get the next sequential record}
  65.    end;
  66.    CloseDataBases;                {Close the file}
  67.    write('Press any Key to continue:');
  68.    repeat until KeyPressed;
  69. end.
  70.